<!-- Author: Brian Mackenzie -->
<!-- Scripts for Sports Coach -->
function GetCookie (name) 
{  
 var arg = name + "=";  
 var alen = arg.length;  
 var clen = document.cookie.length;  
 var i = 0;  
 while (i < clen) 
 {    
  var j = i + alen;    
  if (document.cookie.substring(i, j) == arg)      
  return getCookieVal (j);    
  i = document.cookie.indexOf(" ", i) + 1;    
  if (i == 0) break;   
 }  
 return null;
}

function SetCookie (name, value, expires) 
{  
 var argv = SetCookie.arguments;  
 var argc = SetCookie.arguments.length;  
 var expires = (argc > 2) ? argv[2] : null;  
 var path = (argc > 3) ? argv[3] : null;  
 var domain = (argc > 4) ? argv[4] : null;  
 var secure = (argc > 5) ? argv[5] : false;  
 document.cookie = name + "=" + escape (value) + 
 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
 ((path == null) ? "" : ("; path=" + path)) +  
 ((domain == null) ? "" : ("; domain=" + domain)) +    
 ((secure == true) ? "; secure" : "");
}

function getCookieVal(offset) 
{
 var endstr = document.cookie.indexOf (";", offset);
 if (endstr == -1)
 endstr = document.cookie.length;
 return unescape(document.cookie.substring(offset, endstr));
}

function checkCount(name) 
{
 <!-- Code for the floater -->
 var sname ='pup';
 var count = GetCookie(sname);
 var floater = document.getElementById("floater");
 if (count == null )
  {
   count=1;
   SetCookie(sname, count, null, "/");
  }
 if (count < 5)
  {
  if (count == 1 || count == 4)
   {
    floater.style.display = "block";
   }
  count++;
  SetCookie(sname, count, null, "/");
  }
}

function closeban()
{
 <!-- Code for the floater -->
 var floater = document.getElementById("floater");
 floater.style.display = "none";
}

function floaterpage()
{
<!-- Code for floater for all pages except home page -->
 document.write('<DIV ID="floater" style="display:none"> <DIV ID="floaterTop"><a href="javascript:closeban()">Close this window</a></DIV> <DIV ID="floaterText"> <P style="font: bold 20px Verdana, Arial, sans-serif; margin: 10px, 10px 0 10px;">Free Downloads!  Discover the Secrets to Training for Speed, Power & Strength</p> <p style="font: bold 18px Verdana, Arial, sans-serif; margin: 10px, 10px 0 10px;">Start reading now and we will also send you a <br />Free weekly Sports Training ezine</p>  <p style="font: bold 12px Verdana, Arial, sans-serif; margin: 10px, 10px 0 10px;">For Free Downloads and Weekly Expert Advice - Enter email address:</p> <form action="http://www.pponline.co.uk/miff_external" method="post"> <input type="text" name="email" size="25" maxlength="40"> <input type="hidden" name="source" value="SCphpSCMcore"> <input type="hidden" name="accName" value="sports-performance"> <input type="hidden" name="welcomepage" value="http://www.pponline.co.uk/prewp/freedownload/scmiffwelcome.html"> <input name="unsubscribe" type="submit" title="Submit" value="Submit"> </FORM> <p>We will never give or sell your details to a 3rd party<br /> <a href="http://www.sports-coach.net/scpriv.html">Privacy Policy</a></p> <p><a href="javascript:closeban()">Close this window</a></p> </DIV> </DIV>');
}

function miffboxt(dir)
{
document.write('<table width="245" align="center" border="1" height="110" BGcolor="#3399FF"> <td bgcolor="#FFFF99" align="center" width="240" height="110" Valign="center"><p align="center"><font style="font-family: Verdana; font-size: 10pt; color: red">Download FREE Sports Training<br />and Fitness Reports now.</font><br />Submit Your Email Address:<form action="http://www.pponline.co.uk/miff_external" method="post"><input type="text" name="email" size="25" maxlength="45" style="font-size: 8pt"><input type="hidden" name="source" value="SCylpSCMground"><input type="hidden" name="accName" value="sports-performance"><input type="hidden" name="welcomepage" value="http://www.pponline.co.uk/prewp/freedownload/scmiffwelcome.html"><input name="unsubscribe" type="submit" title="Submit" value="Submit" style="font-size: 8pt"><font style="font-size: 8pt"></font></p></form></td></table>'); 
}

function miffbox(dir)
{
document.write('<h3>Free Sports Training and Fitness Reports from "Peak Performance"</h3><table width="95%" align="center" border="1" cellpadding="2" cellspacing="2" BGcolor="#3399FF"><tr Valign="MIDDLE"> <td align="center" BGcolor="#FFFF66" Valign="MIDDLE"><form action="http://www.pponline.co.uk/miff_external" method="post"><p><font style="font-family: Verdana; font-size: 14pt; color: red">Download FREE Sports Training and Fitness Reports Now</font><br /><font style="font-family: Verdana; font-size: 11pt; color: blue">Submit your email address - </font><input type="text" name="email" size="40" maxlength="45" style="font-size: 10pt"><input type="hidden" name="source" value="SCylpSCMground"><input type="hidden" name="accName" value="sports-performance"><input type="hidden" name="welcomepage" value="http://www.pponline.co.uk/prewp/freedownload/scmiffwelcome.html"><input name="unsubscribe" type="submit" title="Submit" value="Submit" style="font-size: 10pt"></p></form></td></tr></table>');
copy();
}

function adsenset(t)
{
<!-- AdSense top of the page -->
google_ad_client = "pub-6580312449935063";
google_ad_slot = "5029917193";
google_ad_width = 468;
google_ad_height = 60;
 document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>');
}

function adsensem(m)
{
<!-- AdSense middle of the page -->
google_ad_client = "pub-6580312449935063";
google_ad_slot = "7768333893";
google_ad_width = 468;
google_ad_height = 60;
 document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>');
}

function adsenseb(b)
{
<!-- AdSense bottom of the page -->
 document.write('<h3>Additional Information</h3>');
google_ad_client = "pub-6580312449935063";
google_ad_slot = "6059399553";
google_ad_width = 336;
google_ad_height = 280;
 document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>');
}

function topadverts(dir) 
{
 <!-- 2 book images top of the page -->
bm="http://www.brianmac.co.uk/";
pp="http://www.pponline.co.uk/";
document.write('<a href="'+pp+'gold-membership-from-brian-mac" target="_blank"><img src="'+bm+'pplogot.gif" width="86" height="120" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
document.write('<a href="http://shop.pponline.co.uk/shop/complete-sports-science-training-library-6249" target="_blank"><img src="'+bm+'pplibraryt.gif" width="86" height="120" border="0"></a>');
}

function advertise(dir,num)  
{
  <!-- book images at the side of each page -->
var img = [,"http://sports-psychology-tips.com/images/86x120.jpg","http://www.brianmac.co.uk/siblogot.gif","http://www.brianmac.co.uk/pumpupt.gif","http://www.brianmac.co.uk/pplogot.gif","http://www.bestpricenutrition.com/images/best_price_nutrition_buy_now.jpg","http://www.brianmac.co.uk/pplibraryt.gif","pp101t.gif","ppyoungathletest.gif","ppcircuitt.gif","ppspeedt.gif","ppcoret.gif","ppendurancet.gif","pppsycht.gif","pprest.gif","ppcrosst.gif","ppplyot.gif"];

var add = [,"http://www.on2url.com/app/adtrack.asp?MerchantID=118071&AdID=492079","http://www.sportsinjurybulletin.com/prewp/newarch_memberbm.html","http://www.illpumpyouup.com","http://www.pponline.co.uk/gold-membership-from-brian-mac","http://www.bestpricenutrition.com","http://shop.pponline.co.uk/shop/complete-sports-science-training-library-6249","101-evaluation-tests-for-fitness-training","coaching-young-athletes","complete-guide-circuit-training","training-speed-power-strength","core-stability-training","training-for-maximum-endurance","sports-psychology-will-to-win","resistance-training","cross-training-why-and-how-cross-train-maximum-performance","plyometric-training-dynamic-performance"];

  for (i=1; i<17; i++)
  {
	  if(i<7)
	  {
     document.write('<p>&nbsp;</p><p>&nbsp;</p><p align="center"> <a href="'+add[i]+'" target="_blank"> <img src='+img[i]+' width=86 height=120 border="0"></a><p>&nbsp;</p>');
	  }
	  else
	  {
     document.write('<p>&nbsp;</p><p>&nbsp;</p><p align="center"> <a href="http://www.pponline.co.uk/books/'+add[i]+'?src=bmAD" target="_blank"> <img src="http://www.brianmac.co.uk/'+img[i]+'" width=86 height=120 border="0"></a><p>&nbsp;</p>');
	  }
  }
}

function schelp(dir,page)
{
document.write('<h3>Complementary Products</h3> <p align="justify">The following pages provide details of available books &amp; resources that you may find beneficial:</p> <ul><li><a href="http://www.brianmac.co.uk/bmobility.htm">Books & DVD`s</a></li> <li><a href="http://www.brianmac.co.uk/bfootball.htm">Sport Specific Books</a></li> <li><a href="http://www.brianmac.co.uk/products.htm">Training Aids</a></li> <li><a href="http://www.brianmac.co.uk/newsletter.htm">Magazines</a></li> <li><a href="http://www.brianmac.co.uk/clothing.htm">Clothing & Shoes</a></li> </ul>');

sharethis();

document.write('<h3>Need more help?</h3> <p>If you are unable to find the information you are looking for then please <a href="mailto:brian@brianmac.demon.co.uk?subject=Advice required on ' + page + ' "> select this link to email me your query</a> or email me at brian@brianmac.demon.co.uk</p>');
document.write('<h3>Your feedback on the Sports Coach Web Site</h3><p>I would value your feedback on the Sports Coach Web Site as it will help me improve its content. <a href="http://www.brianmac.co.uk/visitorfb.htm">Please select this link to provide your feedback</a>.</p>');
}

function copy()
{
document.write('<p>&nbsp;</p><p>&nbsp;</p><p align="center"><A HREF="http://www.copyscape.com/web-copyright-protection/" target="_blank"><IMG SRC=" http://www.brianmac.co.uk/copy.gif " ALT="Protected by Copyscape Website Copyright Protection" TITLE="Protected by Copyscape Plagiarism Checker - Do not copy content from this page." WIDTH="120" HEIGHT="60" BORDER="0"></A></p><p>&nbsp;</p><p>&nbsp;</p>');	
}

function sharethis()
{
document.write('<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:"01f3d0e9-cba0-4bad-ae1c-d1fbe4d29e6a"});</script>');
document.write('<h3>Share this page with Friends</h3><span class="st_twitter_large" displayText="Tweet"></span><span class="st_facebook_large" displayText="Facebook"></span><span class="st_ybuzz_large" displayText="Yahoo! Buzz"></span><span class="st_gbuzz_large" displayText="Google Buzz"></span><span class="st_email_large" displayText="Email"></span><span class="st_sharethis_large" displayText="ShareThis"></span>');
}